package com.hdb;

import javax.persistence.*;

/**
 * Created by aszer on 2016/11/12.
 */
@Entity
@Table(name = "good", schema = "testin", catalog = "")
public class TGood {
    private int goodId;
    private int classId;
    private String goodName;
    private String goodInfo;
    private String goodPic;
    private int goodPrice;
    private int goodLowPrice;
    private int goodType;
    private int goodInventory;
    private int goodState;
    private int goodSell;

    @Id
    @Column(name = "good_id", nullable = false)
    public int getGoodId() {
        return goodId;
    }

    public void setGoodId(int goodId) {
        this.goodId = goodId;
    }

    @Basic
    @Column(name = "class_id", nullable = false)
    public int getClassId() {
        return classId;
    }

    public void setClassId(int classId) {
        this.classId = classId;
    }

    @Basic
    @Column(name = "good_name", nullable = false, length = 64)
    public String getGoodName() {
        return goodName;
    }

    public void setGoodName(String goodName) {
        this.goodName = goodName;
    }

    @Basic
    @Column(name = "good_info", nullable = false, length = 2048)
    public String getGoodInfo() {
        return goodInfo;
    }

    public void setGoodInfo(String goodInfo) {
        this.goodInfo = goodInfo;
    }

    @Basic
    @Column(name = "good_pic", nullable = false, length = 256)
    public String getGoodPic() {
        return goodPic;
    }

    public void setGoodPic(String goodPic) {
        this.goodPic = goodPic;
    }

    @Basic
    @Column(name = "good_price", nullable = false)
    public int getGoodPrice() {
        return goodPrice;
    }

    public void setGoodPrice(int goodPrice) {
        this.goodPrice = goodPrice;
    }

    @Basic
    @Column(name = "good_low_price", nullable = false)
    public int getGoodLowPrice() {
        return goodLowPrice;
    }

    public void setGoodLowPrice(int goodLowPrice) {
        this.goodLowPrice = goodLowPrice;
    }

    @Basic
    @Column(name = "good_type", nullable = false)
    public int getGoodType() {
        return goodType;
    }

    public void setGoodType(int goodType) {
        this.goodType = goodType;
    }

    @Basic
    @Column(name = "good_inventory", nullable = false)
    public int getGoodInventory() {
        return goodInventory;
    }

    public void setGoodInventory(int goodInventory) {
        this.goodInventory = goodInventory;
    }

    @Basic
    @Column(name = "good_state", nullable = false)
    public int getGoodState() {
        return goodState;
    }

    public void setGoodState(int goodState) {
        this.goodState = goodState;
    }

    @Basic
    @Column(name = "good_sell", nullable = false)
    public int getGoodSell() {
        return goodSell;
    }

    public void setGoodSell(int goodSell) {
        this.goodSell = goodSell;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TGood good = (TGood) o;

        if (goodId != good.goodId) return false;
        if (classId != good.classId) return false;
        if (goodPrice != good.goodPrice) return false;
        if (goodLowPrice != good.goodLowPrice) return false;
        if (goodType != good.goodType) return false;
        if (goodInventory != good.goodInventory) return false;
        if (goodState != good.goodState) return false;
        if (goodSell != good.goodSell) return false;
        if (goodName != null ? !goodName.equals(good.goodName) : good.goodName != null) return false;
        if (goodInfo != null ? !goodInfo.equals(good.goodInfo) : good.goodInfo != null) return false;
        if (goodPic != null ? !goodPic.equals(good.goodPic) : good.goodPic != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = goodId;
        result = 31 * result + classId;
        result = 31 * result + (goodName != null ? goodName.hashCode() : 0);
        result = 31 * result + (goodInfo != null ? goodInfo.hashCode() : 0);
        result = 31 * result + (goodPic != null ? goodPic.hashCode() : 0);
        result = 31 * result + goodPrice;
        result = 31 * result + goodLowPrice;
        result = 31 * result + goodType;
        result = 31 * result + goodInventory;
        result = 31 * result + goodState;
        result = 31 * result + goodSell;
        return result;
    }
}
